Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sane defaults for logfile names #36

Merged
merged 9 commits into from
Aug 11, 2023
Merged

Add sane defaults for logfile names #36

merged 9 commits into from
Aug 11, 2023

Conversation

billdueber
Copy link
Collaborator

Examples:
cictl index today --log today
cictl index full --log full
cictl index today --log something_different.log (will go to /something_different.log)

A few changes:

  • new module CICTL::LogfileDefaults that defines date_named_file templates and default values for daily/full index logs
  • logfile_directory is now separated from logfile name, initially set with ENV["LOG_DIR"] in Services and updated thereafter with CICTL::LogfileDefaults.logdir=
  • Added magic names to send to --log:
    • today or daily gives daily_YYYYMMDD.log
    • full gives full_YYYYMMDD.log * any other string gives the name of a logfile within the logdir
  • Added a --quiet option to suppress all STDERR output (normally it shows errors/fatals)
  • Added a quick log spec that actually works because it checks the file, not stderr
  • Changed rspec tests to clean up logfile after running

@billdueber billdueber assigned billdueber and moseshll and unassigned billdueber Jul 24, 2023
lib/services.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@moseshll moseshll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like everything about this. (Except the fact that the GitHub test action seems to be stalled.)

Examples:
  cictl index today --log today
  cictl index full --log full
  cictl index today --log something_different.log (will go to <logdir>/something_different.log)

A few changes:
  * new module `CICTL::LogfileDefaults` that defines
    date_named_file templates and default values
    for daily/full index logs
  * logfile_directory is now separated from logfile
    name, initially set with `ENV["LOG_DIR"]` in and
    `Services` and updated thereafter with
    `CICTL::LogfileDefaults.logdir=`
  * Added magic names to send to `--log`:
    * `today` or `daily` gives `daily_YYYYMMDD.log`
    * `full` gives `full_YYYYMMDD.log`
    * any other string gives the name of a
      logfile _within the logdir_
  * Added a `--quiet` option to suppress all
    STDERR output (normally it shows errors/fatals)
  * Added a quick log spec that actually works because
    it checks the file, not stderr
  * Changed rspec tests to clean up logfile after running
@moseshll
Copy link
Contributor

moseshll commented Aug 4, 2023

I rebased against main (w/ canister 0.9.2) in case synchronization was throwing the tests into disarray.

@coveralls
Copy link

Coverage Status

coverage: 90.291% (-0.6%) from 90.93% when pulling 490a9f8 on default_logfile_names into 3a715d5 on main.

@moseshll moseshll merged commit b4684ae into main Aug 11, 2023
1 check passed
@coveralls
Copy link

Coverage Status

coverage: 90.291% (-0.6%) from 90.93%
when pulling 490a9f8 on default_logfile_names
into 3a715d5 on main.

@coveralls
Copy link

coveralls commented Nov 9, 2024

Coverage Status

coverage: 90.291% (-0.6%) from 90.93%
when pulling 5165de9 on default_logfile_names
into 05116dd on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants